/**
 * Created by zhijie on 2016/12/15.
 */
/**
 * Created by hezhijie on 2016/11/22.
 */
var merchantListModule = angular.module("merchantList",[]);
merchantListModule.controller("merchantListCtrl", ['$scope',
    function ($scope) {
        $scope.init=function(){
            $scope.searchObject={
                conditions:[],
                pageNum:1,
                pageSize:20
            };
            $scope.queryParams={}
            $scope.queryMerchantList();
        }

        $scope.queryMerchantList=function(){
            $scope.searchObject.conditions=[]
            $.each($scope.queryParams,function(key,value){
                $scope.searchObject.conditions[$scope.searchObject.conditions.length]={
                    colName:key,
                    value:value
                }
            })
            $post(basePath+"/rest/merchant/_query",$scope.searchObject,function(result){
                $scope.resultValue=result.resultValue;
                $scope.$apply();
            })
        }

        $scope.init();
    }
]);
